package com.travelranking.service;

import java.util.List;

import org.springframework.transaction.annotation.Transactional;

import com.travelranking.converter.CountryConverter;
import com.travelranking.dao.RankingDAO;
import com.travelranking.pojo.Country;

@Transactional
public class CountryServiceImpl implements CountryService {
	private RankingDAO dao;
	
	@Override
	public void add(Country c) {
		dao.saveCountry(CountryConverter.toEntity(c));
	}

	@Override
	public List<Country> list() {
		return CountryConverter.toPojoList(dao.listCountry());
	}

	/*
	 * Metodos de acesso ao dao manager
	 */
	public RankingDAO getDao() {
		return dao;
	}
	public void setDao(RankingDAO dao) {
		this.dao = dao;
	}
}
